﻿namespace ApiTemplate.IDAL
{
    /// <summary>
    /// 调度任务
    /// </summary>
    public interface ISchedulerTaskDAL
    {
        /// <summary>
        /// 添加调度任务
        /// </summary>
        /// <param name="schedulerTask"></param>
        /// <returns></returns>
        Task<string> AddAsync(AddSchedulerTaskInput schedulerTask);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="schedulerTask"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(UpdateSchedulerTaskInput schedulerTask);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(BaseGuidListInput input);

        /// <summary>
        /// 获取单个
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<GetSchedulerTaskOutput> GetAsync(string id);

        /// <summary>
        /// 获取分页列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<GetSchedulerTaskPageOutput>> GetPageResultAsync(GetSchedulerTaskPageInput input);

        /// <summary>
        /// 获取所有任务
        /// </summary>
        /// <returns></returns>
        List<GetSchedulerTaskOutput> GetAllSchedulerTaskList();

        /// <summary>
        /// 暂停任务
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> PauseTaskAsync(BaseGuidListInput input);

        /// <summary>
        /// 恢复任务
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> RenewTaskAsync(BaseGuidListInput input);
    }
}
